const my = {
    state: {
        num: 111
    },
    actions: {
        add(state: {num: number}, value: number) {
            state.num += value
        },
        addThunk(state: {num: number}) {
            state.num++
        }
    } as any,
    // 异步方法
    asyncAtions: {
        asyncAdd(dispath: Function) {
            setTimeout(() => {
                dispath({type: 'addThunk'})
            }, 1000)
        }
    },
    actionsName: {} as any
}

// 遍历获取actionsName
for(let key in my.actions) {
    my.actionsName[key] = key
}

export default my